#ifndef _BSP_I2C_H
#define _BSP_I2C_H
#include "gd32f10x.h"

#define I2C_WR	0x00
#define I2C_RD	0x01

void I2C_Start(void);
void I2C_Stop(void);
void I2C_Send_Byte(uint8_t _ucByte);
uint8_t I2C_Read_Byte(uint8_t ack);
uint8_t I2C_Wait_Ack(void);
void i2c_Ack(void);
void i2c_NAck(void);
//uint8_t i2c_CheckDevice(uint8_t _Address);
void i2c_GPIO_Config(void);
uint8_t qst_sw_writereg(uint8_t slave, uint8_t reg_add, uint8_t reg_dat);
uint8_t qst_sw_readreg(uint8_t slave, uint8_t reg_add, uint8_t *buf, uint8_t num);

#endif
